.class public Lcom/jecelyin/editor/v2/widget/SymbolBarLayout;
.super Lcom/jecelyin/editor/v2/widget/c;
.source "SymbolBarLayout.java"

# interfaces
.implements Landroid/view/View$OnClickListener;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/jecelyin/editor/v2/widget/SymbolBarLayout$a;
    }
.end annotation


# instance fields
.field private c:Lcom/jecelyin/editor/v2/widget/SymbolBarLayout$a;

.field private d:[Ljava/lang/String;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 0

    .line 1
    invoke-direct {p0, p1}, Lcom/jecelyin/editor/v2/widget/c;-><init>(Landroid/content/Context;)V

    .line 2
    invoke-direct {p0}, Lcom/jecelyin/editor/v2/widget/SymbolBarLayout;->b()V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 0

    .line 3
    invoke-direct {p0, p1, p2}, Lcom/jecelyin/editor/v2/widget/c;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 4
    invoke-direct {p0}, Lcom/jecelyin/editor/v2/widget/SymbolBarLayout;->b()V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 0

    .line 5
    invoke-direct {p0, p1, p2, p3}, Lcom/jecelyin/editor/v2/widget/c;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 6
    invoke-direct {p0}, Lcom/jecelyin/editor/v2/widget/SymbolBarLayout;->b()V

    return-void
.end method

.method private a(Landroid/content/Context;)V
    .locals 6

    .line 1
    iget-object v0, p0, Lcom/jecelyin/editor/v2/widget/SymbolBarLayout;->d:[Ljava/lang/String;

    if-eqz v0, :cond_1

    array-length v0, v0

    if-nez v0, :cond_0

    goto :goto_1

    .line 2
    :cond_0
    invoke-static {p1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object p1

    .line 3
    iget-object v0, p0, Lcom/jecelyin/editor/v2/widget/SymbolBarLayout;->d:[Ljava/lang/String;

    array-length v1, v0

    const/4 v2, 0x0

    const/4 v3, 0x0

    :goto_0
    if-ge v3, v1, :cond_1

    aget-object v4, v0, v3

    .line 4
    sget v5, Lcom/jecelyin/editor/v2/k;->je_symbol_item:I

    invoke-virtual {p1, v5, p0, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v5

    check-cast v5, Landroid/widget/TextView;

    .line 5
    invoke-virtual {v5, v4}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 6
    invoke-virtual {v5, p0}, Landroid/widget/TextView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 7
    invoke-virtual {p0, v5}, Landroid/view/ViewGroup;->addView(Landroid/view/View;)V

    add-int/lit8 v3, v3, 0x1

    goto :goto_0

    :cond_1
    :goto_1
    return-void
.end method

.method private b()V
    .locals 2

    .line 1
    invoke-virtual {p0}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Lcom/jecelyin/editor/v2/d;->a(Landroid/content/Context;)Lcom/jecelyin/editor/v2/d;

    move-result-object v0

    invoke-virtual {v0}, Lcom/jecelyin/editor/v2/d;->i()Ljava/lang/String;

    move-result-object v0

    const-string v1, "\n"

    .line 2
    invoke-static {v0, v1}, Landroid/text/TextUtils;->split(Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/jecelyin/editor/v2/widget/SymbolBarLayout;->d:[Ljava/lang/String;

    .line 3
    invoke-virtual {p0}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-direct {p0, v0}, Lcom/jecelyin/editor/v2/widget/SymbolBarLayout;->a(Landroid/content/Context;)V

    return-void
.end method


# virtual methods
.method public onClick(Landroid/view/View;)V
    .locals 2

    .line 1
    iget-object v0, p0, Lcom/jecelyin/editor/v2/widget/SymbolBarLayout;->c:Lcom/jecelyin/editor/v2/widget/SymbolBarLayout$a;

    if-nez v0, :cond_0

    return-void

    .line 2
    :cond_0
    move-object v0, p1

    check-cast v0, Landroid/widget/TextView;

    invoke-virtual {v0}, Landroid/widget/TextView;->getText()Ljava/lang/CharSequence;

    move-result-object v0

    invoke-interface {v0}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;

    move-result-object v0

    const-string v1, "\\t"

    .line 3
    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_1

    const-string v0, "\t"

    goto :goto_0

    :cond_1
    const-string v1, "\\n"

    .line 4
    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_2

    const-string v0, "\n"

    .line 5
    :cond_2
    :goto_0
    iget-object v1, p0, Lcom/jecelyin/editor/v2/widget/SymbolBarLayout;->c:Lcom/jecelyin/editor/v2/widget/SymbolBarLayout$a;

    invoke-interface {v1, p1, v0}, Lcom/jecelyin/editor/v2/widget/SymbolBarLayout$a;->a(Landroid/view/View;Ljava/lang/String;)V

    return-void
.end method

.method public setOnSymbolCharClickListener(Lcom/jecelyin/editor/v2/widget/SymbolBarLayout$a;)V
    .locals 0

    .line 1
    iput-object p1, p0, Lcom/jecelyin/editor/v2/widget/SymbolBarLayout;->c:Lcom/jecelyin/editor/v2/widget/SymbolBarLayout$a;

    return-void
.end method
